﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Lucandra.Configuration
{
    [ConfigurationCollection(typeof(CassandraEndpointElement))]
    public class CassandraEndpointCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new CassandraEndpointElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            var e = element as CassandraEndpointElement;
            return string.Format("{0}:{1}", e.Host.ToUpperInvariant(), e.Port);
        }
    }
}
